home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / JPopupMenu$WindowPopup.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  2.2 KB  |  85 lines

  1. package javax.swing;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Frame;
  6. import java.awt.Graphics;
  7. import java.awt.Rectangle;
  8. import java.io.Serializable;
  9. import javax.accessibility.Accessible;
  10. import javax.accessibility.AccessibleContext;
  11.  
  12. class JPopupMenu$WindowPopup extends JWindow implements JPopupMenu.Popup, Serializable, Accessible {
  13.    // $FF: synthetic field
  14.    private final JPopupMenu this$0;
  15.    int saveX;
  16.    int saveY;
  17.    boolean firstShow;
  18.    protected AccessibleContext accessibleContext;
  19.  
  20.    public JPopupMenu$WindowPopup(JPopupMenu var1, Frame var2) {
  21.       super(var2);
  22.       this.this$0 = var1;
  23.       this.firstShow = true;
  24.       this.accessibleContext = null;
  25.    }
  26.  
  27.    public void addComponent(Component var1, Object var2) {
  28.       ((JWindow)this).getContentPane().add(var1, var2);
  29.    }
  30.  
  31.    public AccessibleContext getAccessibleContext() {
  32.       if (this.accessibleContext == null) {
  33.          this.accessibleContext = new JPopupMenu.WindowPopup.AccessibleWindowPopup(this);
  34.       }
  35.  
  36.       return this.accessibleContext;
  37.    }
  38.  
  39.    public Rectangle getBoundsOnScreen() {
  40.       return ((Component)this).getBounds();
  41.    }
  42.  
  43.    public Component getComponent() {
  44.       return this;
  45.    }
  46.  
  47.    public int getHeight() {
  48.       return ((Component)this).getBounds().height;
  49.    }
  50.  
  51.    public int getWidth() {
  52.       return ((Component)this).getBounds().width;
  53.    }
  54.  
  55.    public void hide() {
  56.       super.hide();
  57.       ((Container)this).removeNotify();
  58.    }
  59.  
  60.    public void removeComponent(Component var1) {
  61.       ((JWindow)this).getContentPane().remove(var1);
  62.    }
  63.  
  64.    public void setLocationOnScreen(int var1, int var2) {
  65.       ((Component)this).setLocation(var1, var2);
  66.       this.saveX = var1;
  67.       this.saveY = var2;
  68.    }
  69.  
  70.    public void show(Component var1) {
  71.       ((Component)this).setLocation(this.saveX, this.saveY);
  72.       ((Component)this).setVisible(true);
  73.       if (this.firstShow) {
  74.          this.hide();
  75.          ((Component)this).setVisible(true);
  76.          this.firstShow = false;
  77.       }
  78.  
  79.    }
  80.  
  81.    public void update(Graphics var1) {
  82.       ((Container)this).paint(var1);
  83.    }
  84. }
  85.